'use strict';
exports = module.exports = function($scope) {
    $scope.models = {
        selected: null,
        lists: { "A": [], "B": [] }
    };
    // Generate initial model
    for (var i = 1; i <= 2; ++i) {
        var h = i==1;
        $scope.models.lists.A.push({
            label: "Item A" + i + (h?"单拖":"多拖"),
            single: h
        });
    }
    for (var i = 1; i <= 3; ++i) {
        $scope.models.lists.B.push({ label: "Item B" + i });
    }
    $scope.dnd = {}
    $scope.dnd.Acopied = function( item ){
        console.log("单拖禁止")
        if( item.single ) {
            item.disabled = true
        }
    }
    $scope.dnd.reset = function( ){
        $scope.models.lists.A[0].disabled = false;
        $scope.models.lists.B.splice(0,1);
    }
    // Model to JSON for demo purpose
    $scope.$watch('models', function (model) {
        $scope.modelAsJson = angular.toJson(model, true);
    }, true);
}
